package com.bysc.joinservice.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.*;

import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.bysc.joinservice.handler.LocalDateTimeConverter;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ContentRowHeight(20)
@HeadRowHeight(30)
@ColumnWidth(10)
@HeadStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER)
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER)

public class JoinActivityForm {
    @ExcelProperty({"活动报名表", "序号列"})
    @ApiModelProperty(value = "序号列")
    @ColumnWidth(4)
    private Integer serialNo;
    @ExcelProperty({"活动报名表", "活动主题"})
    @ApiModelProperty(value = "活动主题")
    @ColumnWidth(25)
    private String subject;

    @ExcelProperty({"活动报名表", "姓名"})
    @ApiModelProperty(value = "学生姓名")
    @ColumnWidth(10)
    private String name;

    @ExcelProperty({"活动报名表", "性别"})
    @ApiModelProperty(value = "性别")
    @ColumnWidth(8)
    private String gender;

    @ExcelProperty({"活动报名表", "联系方式"})
    @ApiModelProperty(value = "联系方式")
    @ColumnWidth(18)
    private String phone;

    @ExcelProperty({"活动报名表", "学院"})
    @ApiModelProperty(value = "学院名称")
    @ColumnWidth(30)
    private String collegeName;

    @ExcelProperty({"活动报名表", "专业"})
    @ApiModelProperty(value = "专业名称")
    @ColumnWidth(30)
    private String majorName;

    @ExcelProperty({"活动报名表", "班级"})
    @ApiModelProperty(value = "班级")
    @ColumnWidth(30)
    private String className;

    @ExcelProperty(value = {"活动报名表", "报名时间"},converter = LocalDateTimeConverter.class)
//    @DateTimeFormat("yyyy年MM月dd日HH时mm分ss秒")
    @ApiModelProperty(value = "报名时间")
    @ColumnWidth(30)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

}
